import apiRequest from '@/plugins/apiRequest.js';
import config from 'uview-ui/libs/config/config';
import {
	apiContextPathSsbd
} from "./index.js"
const api = {
	merchant: {
		/**
		 * 根据orgId或orgGuid查企业信息
		 * @param {Object} data
		 */
		getInfo(data) {
			return apiRequest.post(
				apiContextPathSsbd + '/enterprise/getEnterpriseByIdOrGuid',
				data,
				{
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					}
				}
			);
		},
		/**
		 * 获取食材分类
		 */
		getFoodCategory(data) {
			return apiRequest.post(
				apiContextPathSsbd + '/fast/foodType/list'
			);
		},
		/**
		 * 查询当前机构出库过哪些食材
		 */
		getOutStorage(data) {
			return apiRequest.get(
				apiContextPathSsbd + '/chainStandingBookOut/getGroupByTradeName',{
					data
				}
			);
		},
		
		/**
		 * 查当前机构某个食材的出库记录
		 */
		getOutStorageRecord(data) {
			return apiRequest.get(
				apiContextPathSsbd + '/chainStandingBookOut/getByTradeNameAndTime' , {
					data: data
				}
			);
		},
		// 获取商品信息和主体责任
		getOutStorageGoodsDetail(data) {
			return apiRequest.post(
				apiContextPathSsbd + '/chainStandingBookOut/getCommodityInfo' , 
				data,
				{
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					}
				}
			);
		},
		// 获取流通信息
		queryCirculateMsg(data) {
			return apiRequest.get(
				apiContextPathSsbd + '/chainStandingBookOut/queryCirculateMsg' , 
				{
					data:data
				}
			);
		},
		/**
		 * 登录(监管端或上市必登端)
		 */
		login(data) {
			return apiRequest.post(
				apiContextPathSsbd + '/fast/mall/chainLogin',
				data
			);
		},
	},
}

export default api;
